using System.Collections.Generic;
using SmartLink.Domain.Entity;
using SmartLink.DTOS;
using SmartLink.Domain.ExpandEntity.Base;
using SmartLink.Domain.ExpandEntity;
using SmartLink.EnumLibrary;
using SmartLink.DTOS.Permission;

namespace SmartLink.Domain.IServices
{
    public interface IPermissionServices
    {
        bool AllotActionsToRole(int roleId, IList<int> actions);
        bool AllotDataRightsToRole(int roleId, IList<int> dataRights);
        bool AllotMenuIdToRole(bool isOrgManager, int roleId, IList<int> menuIds);
        IList<PER_UserToRole> GetRoleUsers(int roleId);
        void Allot(AuthorizationOwnerTypeEnum ownerType, int ownerId, IEnumerable<int> moduleIds, IEnumerable<int> functionIds);
        void Allot(AuthorizationOwnerTypeEnum ownerType, int ownerId, IEnumerable<int> moduleIds, IEnumerable<int> functionIds, Dictionary<string, IEnumerable<DataAuthorizationItemDTO>> dataAuthorizations);

        IList<PER_ActionPermissions> GetActionPermissionsByUserId(int userId);
        IList<PER_ActionPermissions> GetAllActionPermissions();
        IList<PER_PermissionsGroup> GetAllPermissionsGroup();
        IList<PER_DataPermissions> GetDataPermissionsByUserId(int userId);

        IEnumerable<SYS_Module> GetUserAuthorizedModules(int userId);
        IEnumerable<SYS_ModuleFunction> GetUserAuthorizedFunctions(int userId);
        IEnumerable<SYS_Module> GetAuthorizedModules(AuthorizationOwnerTypeEnum ownerType, params int[] ownerIds);
        IEnumerable<SYS_ModuleFunction> GetAuthorizedFunctions(AuthorizationOwnerTypeEnum ownerType, params int[] ownerIds);
        IEnumerable<PER_DataAuthorization> GetDataAuthorization(AuthorizationOwnerTypeEnum ownerType, params int[] ownerIds);
    }
}